import { IsBoolean, IsOptional, IsString, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class UpdateAddressDto {
  @ApiProperty({ description: '收货人姓名', required: false })
  @IsString()
  @IsOptional()
  @Length(2, 20)
  receiver?: string;

  @ApiProperty({ description: '手机号', required: false })
  @IsString()
  @IsOptional()
  @Length(11, 11)
  phone?: string;

  @ApiProperty({ description: '省份', required: false })
  @IsString()
  @IsOptional()
  @Length(2, 50)
  province?: string;

  @ApiProperty({ description: '城市', required: false })
  @IsString()
  @IsOptional()
  @Length(2, 50)
  city?: string;

  @ApiProperty({ description: '区/县', required: false })
  @IsString()
  @IsOptional()
  @Length(2, 50)
  district?: string;

  @ApiProperty({ description: '详细地址', required: false })
  @IsString()
  @IsOptional()
  @Length(5, 100)
  detail?: string;

  @ApiProperty({ description: '是否默认地址', required: false })
  @IsBoolean()
  @IsOptional()
  isDefault?: boolean;
}
